export default [
  {
    path: '/user',
    layout: false,
    routes: [{ name: '登录', path: '/user/login', component: './User/Login' }],
  },
  { path: '/index', name: '首页', icon: 'HomeOutlined', component: './Index' },
  { path: '/welcome', name: '欢迎', icon: 'smile', component: './Welcome' },
  { path: '/dashboard', name: '仪表盘', icon: 'DashboardOutlined', component: './DashBoard' },
  {
    path: '/interface',
    name: 'API相关',
    icon: 'BugOutlined',
    routes: [
      { path: '/interface/manage', name: '接口管理', component: './InterfaceInfo',access: 'canAdmin' },
      { path: '/interface/invoke', name: '接口调试', component: './InterfaceInfo/Invoke' },
    ],
  },
  {
    path: '/oj',
    name: '在线刷题',
    icon: 'DiscordOutlined',
    routes: [
      { path: '/oj/do/:id', name: 'DoQuestion', component: './OnlineJudge/DoQuestion',hideInMenu:true },
      { path: '/oj/index', name: '题目列表', component: './OnlineJudge/Index' },
      { path: '/oj/manage', name: '题目管理', component: './OnlineJudge/Manage' },
      { path: '/oj/create', name: '创建题目', component: './OnlineJudge/Create' },
    ],
  },
  {
    path: '/execute/code',
    name: '在线执行代码',
    icon: 'UserOutlined',
    component: './OnlineExecute/Index',
  },
  {
    path: '/user/manage',
    name: '用户管理',
    icon: 'UserOutlined',
    component: './User/Manage',
    access: 'canAdmin',
  },
  {
    path: '/user',
    name: '个人页',
    icon: 'smile',
    hideInMenu: true,
    routes: [
      { path: '/user/center', name: '个人中心', component: './User/Center' },
      { path: '/user/settings', name: '个人设置', component: './User/Setting' },
    ],
  },
  {
    path: '/admin',
    name: '管理页',
    icon: 'crown',
    access: 'canAdmin',
    routes: [
      { path: '/admin', redirect: '/admin/sub-page' },
      { path: '/admin/sub-page', name: '二级管理页', component: './Admin' },
    ],
  },
  { path: '/', redirect: '/index' },
  { path: '*', layout: false, component: './404' },
];
